package com.kuizii.base.exception;


import com.kuizii.base.domain.BaseResponse;
import com.kuizii.base.domain.OptStatus;

public class DefaultExceptionResponse extends BaseResponse {
    private final Throwable cause;


    public DefaultExceptionResponse(String message, String detailMsg, int httpStatus, Throwable cause) {
        this.detailMsg = detailMsg;
        this.message = message;
        this.cause = cause;
        this.httpStatus = httpStatus;
    }

    public DefaultExceptionResponse(String msg) {
        this(msg,null,500,null);
    }

    public DefaultExceptionResponse(String msg, int httpStatus) {

        this(msg, null, httpStatus, null);
    }

    public DefaultExceptionResponse(String msg, int httpStatus, Throwable cause) {

        this(msg, null, httpStatus, cause);
    }

    public DefaultExceptionResponse(String msg, int httpStatus, String detailMsg, Throwable cause) {
       this(msg, detailMsg, httpStatus, cause);
    }


    public DefaultExceptionResponse(String message, String detailMsg, Throwable cause) {
        this(message, detailMsg, 500, cause);
    }

    public DefaultExceptionResponse(String message, String detailMsg) {
        this(message, detailMsg,null);
    }

    public DefaultExceptionResponse(String message, Throwable cause) {
        this(message, null, 500, cause);
    }

    @Override
    public String getMessage() {
        return message;
    }

    @Override
    public void setMessage(String message) {
        this.message = message;
    }

    @Override
    public String getDetailMsg() {
        return detailMsg;
    }

    @Override
    public void setDetailMsg(String detailMsg) {
        this.detailMsg = detailMsg;
    }

    @Override
    public int getHttpStatus() {
        return httpStatus;
    }

    @Override
    public void setHttpStatus(int httpStatus) {
        this.httpStatus = httpStatus;
    }

    @Override
    public Integer getOptStatus() {
        return optStatus;
    }

    public void setOptStatus(int optStatus) {
        this.optStatus = optStatus;
    }

    public Integer getErrorCode() {
        return errorCode;
    }

    public void setErrorCode(Integer errorCode) {
        this.errorCode = errorCode;
    }

    private String message;

    private String detailMsg;

    private int httpStatus = 500;

    private Integer optStatus = OptStatus.FAIL;

    private Integer errorCode;
}
